<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<!-- v-for 列表渲染 -->

<body>
    <div id="app">
        <div>
            <h3>普通数组展示</h3>
            <ul>
               <li v-for="p in personArr">{{p}}</li> 
            </ul>
        </div>
        
        <div>
            <h3>对象数组展示</h3>
            <ul>
               <li v-for="p in person">{{p}}</li> 
            </ul>
            <ul>
                <li v-for="p in person">{{p.name}} - {{p.age}} - {{p.address}}</li> 
             </ul>

             <ul>
                <li v-for="(p, index) in person">{{index}} - {{p.name}} - {{p.age}} - {{p.address}}</li> 
             </ul>
        </div>
        

    </div>
    <script src="js/vue.js"></script>

    <script>
        const HelloVue = {
            data() {
                return {
                    personArr:['张三', 20, '武汉'],
                    person:[
                        {'name': '张三', age: 20, address:'武汉'},
                        {'name': '李四', age: 22, address:'北京'},
                        {'name': '王五', age: 24, address:'广州'},
                        {'name': '赵六', age: 21, address:'重庆'},
                    ]
                }
            },
            computed: {

            },
            methods: {
                fun(){
                    
                },
            }
        };

        const app = Vue.createApp(HelloVue).mount("#app");
    </script>
</body>

</html>